﻿@if (Data != null)
{
    <div class="Prop">
        <Button Color="Color.Danger" OnClick="DeleteControl" ButtonStyle="ButtonStyle.None">删除选中控件</Button>
        @if (Data.CtrType == WidgetType.Tab)
        {
            <Button Color="Color.Primary" OnClick="AddTabItem">增加Tab页面</Button>
        }
        @switch (Data.CtrType)
        {
            case WidgetType.SplitH:
            case WidgetType.SplitV:
                <Collapse IsAccordion="true">
                    <CollapseItems>
                        <CollapseItem Text="布局外观">
                            <div class="input-n">
                                <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Basis" TValue="int" Step="1" Max="99" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Height" TValue="int" Step="1" Max="99" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                        </CollapseItem>
                        <CollapseItem Text="特有属性">

                        </CollapseItem>
                        <CollapseItem Text="时间">

                        </CollapseItem>
                    </CollapseItems>
                </Collapse>
                break;
            case WidgetType.Row:
                <Collapse>
                    <CollapseItems>
                        <CollapseItem Text="布局外观">
                            <div class="input-n">
                                <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.MinHeight" TValue="int" Step="10" Max="9999" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                            <div class="input-n">
                                <BootstrapInput @bind-Value="@Data.MinHeightUnit" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Offset" TValue="int" Step="1" Max="12" Min="0" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                        </CollapseItem>
                        <CollapseItem Text="特有属性">

                        </CollapseItem>
                        <CollapseItem Text="事件数据源">

                        </CollapseItem>
                    </CollapseItems>
                </Collapse>
                break;
            case WidgetType.Bottom:
                @if (@Data.Button != null)
                {
                    <Collapse OnCollapseChanged="CollapseChangedForInputText" IsAccordion="true">
                        <CollapseItems>
                            <CollapseItem Text="布局外观">
                                <Switch @bind-Value="@Data.Button.IsDisabled" OffText="可编辑" OnText="只读" OnColor="Color.Dark" OffColor="Color.Success" ShowLabel="false" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.MinHeight" TValue="int" Step="1" Max="100" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.Button.Size" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Offset" TValue="int" Step="1" Max="12" Min="0" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.Button.Color" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.Button.ButtonStyle" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                            </CollapseItem>
                            <CollapseItem Text="特有属性">
                                <Switch @bind-Value="@Data.Button.IsOutline" OnText="显示边框线" OffText="不显示边框线"></Switch>
                                <Switch @bind-Value="@Data.Button.IsAsync" OnText="异步" OffText="同步"></Switch>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.Button.Icon" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                            </CollapseItem>
                            <CollapseItem Text="事件数据源">
                                <Switch @bind-Value="@Data.Button.EnterEnAble" OnText="启用确认(Enter)键" OffText="不启用确认(Enter)键"></Switch>

                                <div class="input-n">
                                    <Select @bind-Value="@Data.Button.RequestParentTable" IsVirtualize="true" OnQueryAsync="OnQueryAsync" ShowLabel="true"></Select>
                                </div>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.Button.RequestParentTableIdName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <Select @bind-Value="@Data.Button.EnterStoreName" IsVirtualize="false" Items="StoreItems" ShowLabel="true" ShowSearch="true"></Select>

                                <CheckboxList IsButton="true" TValue="List<string>" Items="@BoxListData" @bind-Value="@Data.Button.EnterStoreParmeter" ShowLabel="true" DisplayText="存储过程需要的参数" />
                            </CollapseItem>
                        </CollapseItems>
                    </Collapse>
                }
                break;
            case WidgetType.InputText:
                @if (@Data.InputText != null)
                {
                    <Collapse OnCollapseChanged="CollapseChangedForInputText" IsAccordion="true">
                        <CollapseItems>
                            <CollapseItem Text="布局外观">
                                <Select @bind-Value="Data.InputText.LabelPositon" Items="InputTextItems" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                <div class="input-n">
                                    <Switch @bind-Value="@Data.InputText.IsDisabled" OffText="可编辑" OnText="只读" OnColor="Color.Dark" OffColor="Color.Success" ShowLabel="false" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                    <Switch @bind-Value="@Data.InputText.ShowLabel" OffText="不显示标签" OnText="显示标签" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                </div>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.FieldName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.ParameterType" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber  @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Offset" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.InputText.Color" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                            </CollapseItem>
                            <CollapseItem Text="控件属性">
                                <Switch @bind-Value="@Data.InputText.IsAutoFocus" OffText="不自动获取焦点" OnText="自动获取焦点" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                <Switch @bind-Value="@Data.InputText.IsTrim" OffText="不自动清除首位空格" OnText="自动清除首位空格" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                <BootstrapInput @bind-Value="@Data.InputText.PlaceHolder" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                            </CollapseItem>
                            <CollapseItem Text="事件数据源">
                                @if (@Data.InputText != null)
                                {
                                    <Switch @bind-Value="@Data.InputText.EnterEnAble" OnText="启用确认(Enter)键" OffText="不启用确认(Enter)键"></Switch>
                                    <Select @bind-Value="@Data.InputText.EnterStoreName" IsVirtualize="false" Items="StoreItems" ShowLabel="true" ShowSearch="true"></Select>
                                    <CheckboxList IsButton="true" TValue="List<string>" Items="@BoxListData" @bind-Value="@Data.InputText.EnterStoreParmeter" ShowLabel="true" DisplayText="存储过程需要的参数" />
                                    <Switch @bind-Value="@Data.InputText.EscEnAble" OnText="启用返回(Esc)键" OffText="不启用返回(Esc)键"></Switch>
                                }
                            </CollapseItem>
                        </CollapseItems>
                    </Collapse>
                }
                break;
            case WidgetType.None:
                break;
            case WidgetType.FirstPanel:
                <Collapse>
                    <CollapseItems>
                        <CollapseItem Text="布局外观">
                            <BootstrapInputNumber @bind-Value="@Data.Basis" TValue="int" Step="5" Max="90" Min="10" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                        </CollapseItem>
                        <CollapseItem Text="特有属性">

                        </CollapseItem>
                        <CollapseItem Text="时间">

                        </CollapseItem>
                    </CollapseItems>
                </Collapse>
                break;
            case WidgetType.SecondPanel:
                <Collapse>
                    <CollapseItems>
                        <CollapseItem Text="外观布局">

                        </CollapseItem>
                        <CollapseItem Text="特有属性">

                        </CollapseItem>
                        <CollapseItem Text="事件数据源">

                        </CollapseItem>
                    </CollapseItems>
                </Collapse>
                break;
            case WidgetType.Table:
                @if (Data.TableInfo != null)
                {
                    <Collapse OnCollapseChanged="CollapseChangedForInputText" IsAccordion="true">
                        <CollapseItems>
                            <CollapseItem Text="外观布局">
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Height" TValue="int" Step="1" Max="99" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                            </CollapseItem>
                            <CollapseItem Text="特有属性">
                                <Button OnClick="AddColumnForTable">编辑列信息</Button>
                            </CollapseItem>
                            <CollapseItem Text="事件数据源">
                                <div class="input-n">
                                    <Select @bind-Value="@Data.TableInfo.RequestParentTable" IsVirtualize="true" OnQueryAsync="OnQueryAsync" ShowLabel="true"></Select>
                                </div>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.TableInfo.RequestParentTableIdName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                              @*   <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.TableInfo.TableFieldNames" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div> *@
                                @* OnQueryAsync="QueryForStoreName" *@
                                <Select @bind-Value="@Data.TableInfo.RequestAddress" IsVirtualize="false"  Items="StoreItems" ShowLabel="true" ShowSearch="true"></Select>
                                <CheckboxList IsButton="true" TValue="List<string>" Items="@BoxListData" @bind-Value="@Data.TableInfo.RequestParmeter" ShowLabel="true" />
                                @* <CheckboxList IsButton="true" TValue="List<string>" Items="@BoxListData2" @bind-Value="@Data.TableInfo.FieldNameList" ShowLabel="true" /> *@
                            </CollapseItem>
                        </CollapseItems>
                    </Collapse>
                }
                break;
            case WidgetType.Tab:
                <Collapse IsAccordion="true">
                    <CollapseItems>
                        <CollapseItem Text="外观布局">
                            <div class="input-n">
                                <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                            </div>
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>]
                            <div class="input-n">
                                <BootstrapInputNumber @bind-Value="@Data.Height" TValue="int" Step="1" Max="99" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                            </div>
                        </CollapseItem>
                        <CollapseItem Text="特有属性">

                        </CollapseItem>
                        <CollapseItem Text="事件数据源">

                        </CollapseItem>
                    </CollapseItems>
                </Collapse>
                break;
            case WidgetType.TabItem:
                <Collapse IsAccordion="true">
                    <CollapseItems>
                        <CollapseItem Text="外观布局">
                            <div class="input-n">
                                <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                            </div>
                        </CollapseItem>
                        <CollapseItem Text="特有属性">

                        </CollapseItem>
                        <CollapseItem Text="事件数据源">

                        </CollapseItem>
                    </CollapseItems>
                </Collapse>
                break;
            case WidgetType.CheckBox:
                @if (@Data.CheckBox != null)
                {
                    <Collapse OnCollapseChanged="CollapseChangedForInputText" IsAccordion="true">
                        <CollapseItems>
                            <CollapseItem Text="布局外观">
                                <div class="input-n">
                                    <Switch @bind-Value="@Data.CheckBox.IsDisabled" OffText="可编辑" OnText="只读" OnColor="Color.Dark" OffColor="Color.Success" ShowLabel="false" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                    <Switch @bind-Value="@Data.CheckBox.ShowLabel" OffText="不显示" OnText="显示标签" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                </div>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.DisplayName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <div class="input-n">
                                    <BootstrapInput @bind-Value="@Data.FieldName" TValue="string" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInput>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Width" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <BootstrapInputNumber @bind-Value="@Data.Offset" TValue="int" Step="1" Max="12" Min="1" ShowButton="true" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></BootstrapInputNumber>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.CheckBox.Size" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                                <div class="input-n">
                                    <Select @bind-Value="@Data.CheckBox.Color" ShowLabel="true" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Select>
                                </div>
                            </CollapseItem>
                            <CollapseItem Text="控件属性">
                                <div class="input-n">
                                    <Switch @bind-Value="@Data.Values.ValueBool" OffText="勾选" OnText="未勾选" OnColor="Color.Dark" OffColor="Color.Success" ShowLabel="false" OnValueChanged="async(e)=>{await MainPage.StateHasChangedInvoke();}"></Switch>
                                </div>
                            </CollapseItem>
                            <CollapseItem Text="事件数据源">
                                @if (@Data.CheckBox != null)
                                {
                                    <Switch @bind-Value="@Data.CheckBox.ChangeEnAble" OnText="状态改变执行" OffText="状态改变不执行"></Switch>
                                    <Select @bind-Value="@Data.CheckBox.ChangeStoreName" IsVirtualize="false" Items="StoreItems" ShowLabel="true" ShowSearch="true"></Select>
                                    <CheckboxList IsButton="true" TValue="List<string>" Items="@BoxListData" @bind-Value="@Data.CheckBox.ChangeStoreParmeter" ShowLabel="true" DisplayText="存储过程需要的参数" />
                                }
                            </CollapseItem>
                        </CollapseItems>
                    </Collapse>
                }
                break;
            default:
                break;
        }
    </div>

}


